<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       
        for(var i=0;i<5;++i){
    var str="";
    for(var j=0;j<i*2+1;++j){
        str=str+"*"    ;
    }
    console.log(str);
    
}
'<br/>'

for(var i=0;i<5;++i){
    var str="";
    for(var j=0;j<9-i*2;++j){
        str=str+"*"    ;
    }
    console.log(str);
} 

var str="";
  for(var i=5;i>0;i--){
   
      for(var j=0;j<i;j++){
         str=str+"*"
      }
      str=str+"<br/>"
  }
  document.write(str)

  var str=""
  for(var i=0;i<5;i++){
      for(var j=0;j<i+1;j++){
        str=str+"*"
      }
      str=str+"<br/>"
  }
  document.write(str)
 </script>
</body>
</html>